/*
 * DomValues.java
 *
 * Created on July 24, 2007, 1:46 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.avid.jdomvals;

//import java.io.File;
//import java.io.FileNotFoundException;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.Iterator;
//import java.util.List;
//import org.jdom.Document;
//import org.jdom.Element;
//import org.jdom.JDOMException;
//import org.jdom.filter.ElementFilter;
//import org.jdom.input.SAXBuilder;
//
///**
// *
// * @author Administrator
// */
//public class DomValues {
//
//    @SuppressWarnings(value = "unchecked")
//    List<Element> list = new ArrayList();
//    Element[] elements = new Element[0];
//
//    /**
//     * Creates a new instance of DomValues
//     */
//    public DomValues(File path, File xmlFile) throws JDOMException, IOException {
//        SAXBuilder builder = new SAXBuilder();
//        Document doc;
//        File realFile = new File(path, xmlFile.toString());
//        try {
//            doc = builder.build(realFile);
//
//            Iterator itr = doc.getDescendants(new ElementFilter());
//            while (itr.hasNext()) {
//                Element e = (Element) itr.next();
//                list.add(e);
//            }
//            realFile.delete();
//        } catch (FileNotFoundException ex) {
//            ex.printStackTrace();
//        } catch (JDOMException ex) {
//            ex.printStackTrace();
//        } catch (IOException ex) {
//            ex.printStackTrace();
//        }
//    }
//
//    /**
//     * @param args the command line arguments
//     */
//    public static void main(String[] args) throws JDOMException, IOException {
//        // TODO code application logic here
//        File xmlFile = new File("block_update_tt.xml");
//        File path = new File("C:\\python_scripts\\fs\\tests\\write\\");
//        DomValues main = new DomValues(path, xmlFile);
//
//        main.getList();
//    }
//
//    public ArrayList getList() {
//        return (ArrayList) list;
//    }
//
//    @SuppressWarnings(value = "unchecked")
//    public void setList(ArrayList list) {
//        this.list = list;
//    }
//}
